package com.ruoyi.aitcommon.vo;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.aitcommon.utils.JSONUtils;
import com.ruoyi.aitcommon.utils.ObjUtils;

import java.util.LinkedHashMap;
import java.util.Map;

public class RestCallVO {
    private String url;
    private String head;
    private String method;
    private String body;
    private String response;

    public Map<String,Object> getHeadMap(){
        LinkedHashMap<String,Object> headmap=new LinkedHashMap<>();
        if(ObjUtils.isBlank(this.head))
            return null;
        if(!JSONUtils.validJSONObjectStr(this.head))
            return null;
        return JSONObject.parseObject(this.head);
    }
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getHead() {
        return head;
    }

    public void setHead(String head) {
        this.head = head;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }
}
